<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			div{
				text-align:center;
			}
			img{
				width:200px;
			}
		</style>
	</head>

	<body>
		<div id="luckyimg"></div>
		<div><input type="button" value="抽奖" id="choujiang"/></div>
	</body>
	<script>
		var photos=['<img src="古力娜扎.jpg"/>','<img src="炎亚纶.jpg"/>','<img src="张翰.jpg"/>'];
		luckyimg.innerHTML=photos[0];
		var timer;
		choujiang.onclick=function(){
			if(choujiang.value=="停"){
				clearInterval(timer);
				choujiang.value="抽奖";
			}else{
				timer=setInterval(f,10);
				choujiang.value="停";
			}
		}
		function f(){
			luckyimg.innerHTML=photos[Math.floor(Math.random()*photos.length)];
		}
	</script>
</html>